package com.ft.turorial.spring.boot.web.util;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.ModelAndView;

@Component
public class ModelAndViewUtil {
	
	private static String staticServerUrl = "http://localhost:8080";
	
	@Value("${spring.static.server-url}")
	public void setHost(String staticServerUrl) {
		ModelAndViewUtil.staticServerUrl = staticServerUrl;
	}

	public static ModelAndView newInstance(){
		ModelAndView modelAndView = new ModelAndView();
		modelAndView.addObject("staticServerUrl", staticServerUrl);
		return modelAndView;
	}
}
